package fzu.functiongather.RightPop;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.widget.DrawerLayout;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import fzu.functiongather.R;

/**
 * Created by Administrator on 2016/8/31.
 */
public class RightPopActivity extends Activity implements View.OnClickListener{
    private LinearLayout v_ll_investment_drawer;
    private DrawerLayout v_dl_investment;
    private ImageView v_iv_investment_search;
    private TextView v_tv_investment_complete;
    private int screenWidth;
    private int screenHeight;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        DisplayMetrics dm = getResources().getDisplayMetrics();
        screenWidth = dm.widthPixels;
        screenHeight = dm.heightPixels - 150;
        setContentView(R.layout.rightpop_main);
        initView();
    }



    private void initView(){
        v_iv_investment_search = (ImageView) findViewById(R.id.v_iv_investment_search);;
        v_dl_investment = (DrawerLayout) findViewById(R.id.v_dl_investment);
        v_ll_investment_drawer = (LinearLayout) findViewById(R.id.v_ll_investment_drawer);
        v_tv_investment_complete = (TextView)findViewById(R.id.v_tv_investment_complete);
        v_dl_investment.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
        v_iv_investment_search.setOnClickListener(this);
        v_tv_investment_complete.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.v_iv_investment_search:
                //点击打开条件选择界面
                v_dl_investment.openDrawer(Gravity.RIGHT);
                break;
         /*   case R.id.v_tv_investment_reset:
                //重置条件选择界面
                new resetDrawerTask().execute();
                break;*/
            case R.id.v_tv_investment_complete:
                //关闭条件选择界面
                v_dl_investment.closeDrawer(v_ll_investment_drawer);
                break;
        }
    }
}
